import React from "react"
import { Button } from "esy-ui"
import { useTranslation } from "react-i18next"

const btns = ["primary", "link", "ghost", "success", "warning", "error"]
export const DemoL1 = () => {
    const { t } = useTranslation()

    const onClick = () => {
        // 点击事件
    }

    return (
        <div>
            <div className="flex items-center gap-2">
                <Button onClick={onClick}>{t("default")}</Button>
                {btns.map((tp) => (
                    <Button key={tp} type={tp} onClick={onClick}>
                        {t(tp)}
                    </Button>
                ))}
            </div>
        </div>
    )
}

export const demoL1Json = () => `
import React from "react"
import { Button } from "esy-ui"
import { useTranslation } from "react-i18next"

const btns = ["primary", "link", "ghost", "success", "warning", "error"]
export const DemoL1 = () => {
    const { t } = useTranslation()

    const onClick = () => {
        // 点击事件
    }

    return (
        <div>
            <div className="flex items-center gap-2">
                <Button onClick={onClick}>{t("default")}</Button>
                {btns.map((tp) => (
                    <Button key={tp} type={tp} onClick={onClick}>
                        {t(tp)}
                    </Button>
                ))}
            </div>
        </div>
    )
}
`
